package com.neuedu.hisboot.controller;

import com.neuedu.hisboot.dto.Result;
import com.neuedu.hisboot.entity.Customer;
import com.neuedu.hisboot.entity.Department;
import com.neuedu.hisboot.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jaun
 * @since 2025-07-04
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private IDepartmentService departmentService;
    @GetMapping("/list")
    public Result<List<Department>> getdepartments(){
        List<Department> departments = departmentService.list();
        return Result.success(departments);
    }
}
